<?php
/**
 * The Sidebar containing the primary and secondary widget areas.
 */
?>

<?php if (is_home()) : ?>
	<div class="right-content">
		<div class="block block-type-2">
			<h2 class="title-block">Tin tức</h2>
			<?php
				$loop = new WP_Query('posts_per_page=2');
				if ($loop->have_posts()) : 
					while ($loop->have_posts()) : $loop->the_post();
			?>
				<div class="block-content">
					<div class="related">
						<h3><a title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
						<p class="txt-type-1">
							<?php echo get_the_excerpt(); ?>
						</p>
						<?php if(has_post_thumbnail()) : ?>
							<a class="thumbnail" title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>">
								<?php the_post_thumbnail('thumbnail'); ?>
							</a>
						<?php endif; ?>
						<a class="more-content" title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>">Xem thêm</a>
					</div>
				</div>
			<?php endwhile; endif; ?>
		</div>
	</div>
<?php endif; ?>